﻿<Window x:Class="YiJing.Views.ShellView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Local="clr-namespace:YiJing.Controls" WindowStartupLocation="CenterScreen" ResizeMode="NoResize"
        Height="350" Width="400">
    <DockPanel Margin="4">

        <ComboBox x:Name="List" DockPanel.Dock="Top" Grid.IsSharedSizeScope="true" SelectedIndex="{Binding SelectedValue}" Margin="0,0,0,4" >
            <ComboBox.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="FontSize" Value="14" />
                    <Setter Property="Foreground" Value="SlateGray" />
                </Style>
            </ComboBox.Resources>
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <Grid Margin="4">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" SharedSizeGroup="HexValue" />
                            <ColumnDefinition Width="300" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Local:Hexagram Value="{Binding Value}" Height="32" Width="30" />
                        <TextBlock Grid.Column="1" Margin="8,0,8,0" Text="{Binding Value,Mode=OneTime}" MinWidth="14" />
                        <TextBlock Grid.Column="2" TextWrapping="Wrap" Text="{Binding Interpretation, Mode=OneTime}" />
                    </Grid>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>


        <StackPanel DockPanel.Dock="Right" Width="85" Margin="4,0,0,0">
            <StackPanel.Resources>
                <Style TargetType="Button">
                    <Setter Property="Margin" Value="0,0,0,5"/>
                </Style>
            </StackPanel.Resources>
            <Button x:Name="GenerateFromToss" Content="Coin _Toss..." />
            <Button x:Name="Generate" Content="Random" />
            <Button x:Name="Move" Content="Move" />
            <Button x:Name="Flip" Content="_Flip" />
        </StackPanel>

        <Expander Header="Trigram Details" DockPanel.Dock="Bottom" IsExpanded="{Binding Path=Hexagram.ShowTrigramDetails}" MinHeight="100" >
            <StackPanel Margin="26,0,20,0" DataContext="{Binding Path=Hexagram.SelectedTrigram.Figure}">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Path=Details.Name.Symbol}" />
                    <TextBlock>
                        <Run Text="{Binding Path=Details.Translation}"  />
                        <LineBreak/>
                        <Run Text="{Binding Path=Details.Name.Text}" /> (<Run Text="{Binding Path=Details.Nature.Text}" />)
                    </TextBlock>
                </StackPanel>
            </StackPanel>
        </Expander>
        <ContentControl x:Name="Hexagram" IsTabStop="false" />
    </DockPanel>
</Window>
